/**
 * 
 */
package de.cbf.cam.dsa.model.entities.weapon.valueModifier;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import de.cbf.cam.dsa.model.entities.weapon.OneWeapon;
import de.cbf.cam.dsa.model.entities.weapon.WeaponMelee;

/**
 * @author Nebelritter
 *
 */
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class WeaponINIModifier extends WeaponValueModifier {
	/**
	 * @uml.property  name="iniMod"
	 */
	private int iniMod;
	
	public WeaponINIModifier(int type, int iniMod) {
		super(type);
		this.iniMod = iniMod;
	}



	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.entities.weapon.valueModifier.WeaponValueModifier#modifyWeaponValue(de.cbf.cam.dsa.model.entities.weapon.OneWeapon)
	 */
	@Override
	public void modifyWeaponValue(OneWeapon weapon) {
		if (weapon instanceof WeaponMelee) {
			WeaponMelee weaponMelee = (WeaponMelee) weapon;
			weaponMelee.setIniMod(weaponMelee.getIniMod()+iniMod);			
		}		
	}



	@Override
	public void unModifyWeaponValue(OneWeapon weapon) {
		if (weapon instanceof WeaponMelee) {
			WeaponMelee weaponMelee = (WeaponMelee) weapon;
			weaponMelee.setIniMod(weaponMelee.getIniMod()-iniMod);			
		}				
	}



	/**
	 * @return
	 * @uml.property  name="iniMod"
	 */
	public int getIniMod() {
		return iniMod;
	}



	/**
	 * @param iniMod
	 * @uml.property  name="iniMod"
	 */
	public void setIniMod(int iniMod) {
		this.iniMod = iniMod;
	}
}
